| Name | Dialog Script Containers |
| Description | Dialog script containers define custom UI dialogs using the Paper dialog system.
Requires a Paper server. Note that dialogs are a client-facing UI feature, unrelated to NPC speech. Each dialog requires a 'base' section that defines general properties and the dialog type. TYPES: - confirm : Two-button confirmation dialog (yes/no) - notice : Simple dialog with a single button - list : Shows a list of other dialog scripts - multi : Grid layout with multiple action buttons AFTER ACTION: 'base.after action' controls what the client does with the dialog screen after a button is clicked: - close (default) : closes the dialog and returns to the screen behind it - none : leaves the dialog open, so the script decides what comes next - wait_for_response : replaces the dialog with a 'waiting for response' screen Prefer 'none' for a button that opens another dialog: with 'close' the client drops back to the game screen in between, which re-grabs the mouse and moves the cursor to the center of the screen. When using 'none', end an interaction by closing the dialog from the script with PlayerTag.close_dialog. This covers the exit button and the Escape key too, so a 'list' or 'multi' dialog set to 'none' needs an 'exit button' whose script closes the dialog, or the player has no way out of it. Note that dialogs shown by this container never pause the game, which is what keeps 'none' usable. DEFINITIONS: Use a 'definitions' key to name the definitions passed in by showdialog, in the same format as task script containers. DYNAMIC GENERATION (Procedural): You can define a 'procedural' script section at the root of the container. This executes a Denizen queue when opening the dialog, allowing you to dynamically construct and determine maps for 'inputs', 'bodies', or 'buttons'. Any statically defined elements in the dialog container will be cleanly merged with the generated maps. Note: you can naturally use click-time tags like '<context.button_id>' inside these dynamic scripts, they are automatically escaped at load-time to prevent premature execution. |
| Group | Script Container System |
| Source | https://github.com/MINEZ/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/containers/DialogScriptContainer.java#L68 |